unit SUVirtualTarget;

interface
  uses
    SUStealth;

  Type
    PVirtualTarget = class
        private
          class var _Instance : PVirtualTarget;
          constructor Create;
    function SinGetLTarget: TTargetInfo;
    function SinIsActive: Boolean;
        public
          class function GetInstance():PVirtualTarget;

          procedure UseObjectCursor();
          procedure UseTileCursor();

          property LastTarget : TTargetInfo read SinGetLTarget;
          property Active     : Boolean     read SinIsActive;
    end;

implementation

{ PVirtualTarget }

constructor PVirtualTarget.Create;
begin
  //virtual
end;

class function PVirtualTarget.GetInstance: PVirtualTarget;
begin
  if not Assigned(_Instance) then _Instance := PVirtualTarget.Create;
  Result := _Instance;
end;

function PVirtualTarget.SinGetLTarget: TTargetInfo;
begin
  Result := Script.Client.TargetResponse;
end;

function PVirtualTarget.SinIsActive: Boolean;
begin
  Result := not Script.Client.TargetResponsePresent();
end;

procedure PVirtualTarget.UseObjectCursor;
begin
  Script.Client.RequestObjectTarget;
end;

procedure PVirtualTarget.UseTileCursor;
begin
  Script.Client.RequestTileTarget;
end;

end.
